namespace Jumpton.SFA.Server.Entity {
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;

    [System.SerializableAttribute()]
    [RelationMap("ROUTE_CUSTOMERS", typeof(ROUTE_CUSTOMERS), "a")]
    [Relation(RelationJoinType.Inner, typeof(CUSTOMERS), "b", "a", "ID", "CUSTOMER_ID")]
    public class ROUTECUSTOMERSVIEW : ObjectRow {
        public ROUTECUSTOMERSVIEW()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public ROUTECUSTOMERSVIEW(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected ROUTECUSTOMERSVIEW(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID", TableAlias = "a")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("USER_ID", TableAlias = "a")]
        public decimal USERID
        {
            get
            {
                return (System.Decimal)GetValue("USERID");
            }
            set
            {
                SetValue("USERID", value);
            }
        }

        [Field("ROUTE_NUMBER", TableAlias = "a")]
        public decimal ROUTENUMBER
        {
            get
            {
                return (System.Decimal)GetValue("ROUTENUMBER");
            }
            set
            {
                SetValue("ROUTENUMBER", value);
            }
        }

        [Field("CUSTOMER_ID", TableAlias = "a")]
        public decimal CUSTOMERID
        {
            get
            {
                return (System.Decimal)GetValue("CUSTOMERID");
            }
            set
            {
                SetValue("CUSTOMERID", value);
            }
        }

        [Field("SEQUENCE", TableAlias = "a")]
        public decimal SEQUENCE
        {
            get
            {
                return (System.Decimal)GetValue("SEQUENCE");
            }
            set
            {
                SetValue("SEQUENCE", value);
            }
        }

        //[Field("VALID_DATE", TableAlias = "a")]
        //public decimal VALIDDATE
        //{
        //    get
        //    {
        //        return null == GetValue("VALIDDATE") ? 0 : (System.Decimal)GetValue("VALIDDATE");
        //    }
        //    set
        //    {
        //        SetValue("VALIDDATE", value);
        //    }
        //}

        [Field("ACTIVE", TableAlias = "a")]
        public bool ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("LAST_UPDATER", TableAlias = "a")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME", TableAlias = "a")]
        public decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("CREATE_TIME", TableAlias = "a")]
        public decimal CREATETIME
        {
            get
            {
                return (System.Decimal)GetValue("CREATETIME");
            }
            set
            {
                SetValue("CREATETIME", value);
            }
        }

        [Field("NAME", TableAlias = "b")]
        public string CUSTOMERNAME
        {
            get
            {
                return (System.String)GetValue("CUSTOMERNAME");
            }
            set
            {
                SetValue("CUSTOMERNAME", value);
            }
        }
    }
}
